package com.szj.service.impl;

import com.szj.entity.Admin;
import com.szj.entity.Grade;
import com.szj.entity.LoginForm;
import com.szj.mapper.AdminMapper;
import com.szj.mapper.GradeMapper;
import com.szj.service.AdminService;
import com.szj.service.GradeService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class GradeServiceImpl implements GradeService {
    @Autowired
    private GradeMapper gradeMapper;

    @Override
    public List<Grade> gradeAll() {
        return gradeMapper.gradeAll();
    }

    //添加年级
    @Override
    public int gradeAdd(Grade grade) {
        return gradeMapper.gradeAdd(grade);
    }

    //删除年级信息
    @Override
    public int gradeDel(Integer[] ids) {
        return gradeMapper.gradeDel(ids);
    }

    //修改年级信息
    @Override
    public int gradeUp(Grade grade) {
        return gradeMapper.gradeUp(grade);
    }

    //查找指定年级名称是否存在
    @Override
    public Grade findByName(String name) {
        return gradeMapper.findByName(name);
    }

    //查询年级信息
    @Override
    public List<Grade> selectList(Grade grade) {
        return gradeMapper.selectList(grade);
    }

}